<?php 
global $_GPC,$_W;

// 添加活动
// 跳转到添加界面
if($_GPC['et'] ==2) {
    //$sql1=pdo_getall('ims_szxh_nmyx_activeexpirty_actionsort');
    include $this->template('adsortindex');
    return;
}

//点击保存后判空
if($_GPC['et'] == 3) {

    $table = new TianjaihuodongTable();
    $insertdate = $table->insertDate($_POST);

    /*$arr = array('sortname' => $da['name']);
    if(empty($_GPC['name'])) {
         return message('类别不能为空','refresh','error');
    }
    $sql = pdo_insert('szxh_nmyx_activeexpirty_actionsort',$arr);*/
    $sql=pdo_getall('ims_szxh_nmyx_activeexpirty_actionsort');
    //var_dump($sql);
    include $this->template('sortindex');
    return;
}

//通过点击修改按钮获取数据
if($_GPC['et'] == 4) {
    //$uid = $_GPC['uid'];
    //var_dump($uid);

    $table = new TianjaihuodongTable();
    $row = $table->getRow($_GPC['uid']);

    //$row = pdo_get('szxh_nmyx_activeexpirty_actionsort',array('uid'=>$uid));
    //var_dump($row);
    include $this->template('chsortindex');
    return;
}

//数据更新

if($_GPC['et'] == 5) {
    /*$date1 = $_POST;
    $uid = $_POST['uid'];
    $name = $date1['name'];*/

    $table = new TianjaihuodongTable();
    $up = $table->upDate($_POST,$_POST['uid']);
    //var_dump($name);
   /* $arr = array('sortname' => $date1['name']);
    $up = pdo_update('szxh_nmyx_activeexpirty_actionsort',$arr,array('uid' => $uid));*/
    return;
}
//数据删除
if($_GPC['et'] == 6) {
    $arr = $_POST['checkname'];
    //var_dump($arr);

    $table = new TianjaihuodongTable();
    $del = $table->delateDate($_POST['checkname']);    
    
   /* foreach ($arr as $value) {
        $del = pdo_delete('szxh_nmyx_activeexpirty_actionsort',array('uid' => $value)); 
    }*/
    return;
}
// var_dump($this->createMobileUrl('home'));
//$sql=pdo_getall('ims_szxh_nmyx_activeexpirty_actionsort');

$table = new TianjaihuodongTable();
$sql1 = $table->getList($_GET['page']);
// var_dump($sql1);
$html = $table->pageHtml();
//var_dump($sql);
include $this->template('sortindex');
?>